The present invention relates to digital representations of typographic characters or other symbols, and more particularly, to a system, method, and computer-readable medium for converting an outline font into a glyph-based font.
Many font generating systems exist for generating Asian character fonts (xe2x80x9cAsian fontsxe2x80x9d). An Asian font is composed of a large number of ideographs that represent the characters in the Asian language. Asian languages may include thousands of characters. For example, the Chinese language includes over twenty thousand distinct characters.
One conventional computer technique for generating character patterns in an Asian font uses font outlines. This system is described in xe2x80x9cPostScript Language Tutorial and Cookbookxe2x80x9d by Adobe Systems, Inc. (Addison-Wesley Publishing, 1985). In this method, the outline of a character pattern is stored as a collection of straight lines and curves. There are some disadvantages associated with this technique. First, because different font outlines must be defined and stored for tens of thousands of different characters, the memory requirement is relatively high. Second, the font outlines that are stored in high resolution are suited for display only in high resolution; they are not suited for high-quality display in relatively low resolution. Third, an outline font is not suited for communication between different systems, in particular different systems having different resolutions, due to the relatively high memory requirement and also due to the inability to adjust to both high- and low-resolution displays.
To overcome these disadvantages associated with an outline font, a method for generating a glyph-based font has been proposed, and is described in copending U.S. patent application Ser. No. 09/425,449 (filed Oct. 22, 1999), which is assigned to the assignee of the present application and explicitly incorporated herein. As used herein, a glyph is a subunit of an Asian character; an Asian character typically consists of one or more glyphs. Each glyph, in turn, is formed of one or more strokes. In the glyph-based font, each character is defined as a combination of glyphs, and each glyph is defined separately. The glyph-based font has a low memory requirement, is capable of displaying characters in both high and low resolutions, and thus is well suited for font communication between different systems having different resolutions.
To take advantage of the glyph-based font suitable for font communication, a need exists for a system, method, and computer-readable medium for automatically converting any captured outline font found in a document into a glyph-based font so that the document can be freely communicated between different systems having different resolutions.
The present invention provides a method and system for defining a set of basic glyphs. The invention further provides a method and computer-readable medium having computer-executable instructions for automatically converting an outline font into a glyph-based font using the predefined basic glyphs. The glyph-based font of the present invention has a low memory requirement, is suitable for font communication between different computers, and can be rendered in high quality on both high- and low-resolution output devices.
Specifically, a method and system for defining a set of basic glyphs for defining glyphs and characters based thereon are provided. According to the method, first, a set of characters that include similarly shaped glyphs is retrieved. Next, one basic glyph is selected, which best represents all the similarly shaped glyphs topographically. For the selected basic glyph, feature points are defined along the outline of the basic glyph. The defined feature points are then stored as a glyph signature. A glyph signature represents the structure in which all feature points of a glyph are arranged. Generally, all glyphs that one basic glyph topographically represents share the same glyph signature. Next, key points are defined for the selected basic glyph. Generally, key points are placed at the beginning and terminus of a basic glyph and at any location where a basic glyph changes direction abruptly. Next, width values are defined for the selected basic glyph. Width values are defined on the basic glyph so that the shape of the basic glyph can be manipulated to match any of the similarly shaped glyphs that the basic glyph represents by decreasing or increasing the width values. Thereafter, for the selected basic glyph, equations are defined that obtain the feature points based on the key points and the width values of the selected basic glyph. Then, script sentences are defined that obtain the key points and the width values based on the feature points of the selected basic glyph. At this point, the selected basic glyph is fully defined and is stored as a program for rendering the basic glyph for output. The above process is then repeated for another basic glyph, until all glyphs included in the retrieved set of characters are represented by at least one basic glyph.
In accordance with one aspect of the present invention, the step of identifying feature points along the outline of a glyph may be performed automatically. According to the automatic process, first, a glyph is fitted within a minimum square. Then, feature points are identified at the leftmost, lowermost, rightmost, and uppermost edges of the minimum square. At this time, if all curve segments between two consecutive feature points are not on the same side of the line connecting the two feature points, feature points are identified at inflection points. Further, any acute-angle points are identified as feature points. Thereafter, a minimum square is formed for each pair of two adjacent feature points. If any curve segment between the two feature points lies outside the minimum square, the minimum square is expanded until it contains all curve segments between the two feature points and feature points are identified at the leftmost, lowermost, rightmost, and uppermost edges of the minimum square.
In accordance with another aspect of the present invention, the basic glyph definition process may further include the step of defining curve ratios for creating curve segments between adjacent feature points of a basic glyph. Curve ratios are defined at various resolution levels and stored in a tree-structure curve level table. Curve ratios are defined in greater detail at a higher resolution level and in less detail at a lower resolution level. Thus defined curve segments are rendered in equally high quality on both high-resolution output devices and low-resolution output devices.
In accordance with yet another aspect of the present invention, the basic glyph is divided into one or more single run-length regions. A single run-length region is an area within the basic glyph that contains no holes and can be filled with a single scan run. Thus, storing the basic glyph as a collection of several single run-length regions makes it simpler to fill within the basic glyph.
In accordance with still another aspect of the present invention, any key point that requires a specific display location with respect to a bitmap cell upon which the key point falls may be labeled with hint information. Labeling key points with hint information serves to avoid jamming or distortion of a glyph upon display, in particular in low resolution.
The present invention further provides a method and computer-readable medium having computer-executable instructions for automatically converting an outline font character into a glyph-based font character using a set of predefined basic glyphs stored in a basic glyph database. As described above, each of the basic glyphs is predefined as a program for rendering the basic glyph for output. Additionally, each of the basic glyphs is associated with a glyph signature consisting of feature points of the basic glyph, and is further associated with script sentences that obtain key points and width values based on the feature points of the basic glyph. According to the automatic font conversion method, first, an outline font character to be redefined is captured. Then, a glyph is selected from the captured character. Thereafter, feature points are identified automatically along the outline of the selected glyph and stored in a glyph signature. Next, the basic glyph database is searched for a basic glyph that topographically matches the selected glyph, and this basic glyph is retrieved. Next, the script sentences associated with the retrieved basic glyph are retrieved, and used together with the feature points of the selected glyph identified above to obtain key points and width values for the selected glyph. Thereafter, the selected glyph with its key points and width values is stored as a program for rendering the selected glyph for output. At this point, the selected glyph is fully redefined. The above process of defining the selected glyph is repeated for all glyphs included in the captured outline font character, i.e., until the outline font character is fully redefined based on its glyphs into a glyph-based font character.
In accordance with one aspect of the present invention, when the basic glyph database is searched for a basic glyph that topographically matches the selected glyph, a basic glyph whose glyph signature matches the glyph signature of the selected glyph is retrieved.
In accordance with another aspect of the present invention, the program for rendering each basic glyph for output includes equations for obtaining the feature points of the basic glyph based on the key points and width values of the basic glyph. The program further includes curve ratios stored in a curve level table for creating curve segments between adjacent feature points. When the program for rendering the selected glyph is created, such a program includes the equations and the curve ratios of the retrieved basic glyph that topographically matches the selected glyph.
In accordance with yet another aspect of the present invention, the program for rendering each basic glyph for output further includes a filling algorithm including one or more single run-length regions. When the program for rendering the selected glyph is created, such a program further includes the filling algorithm of the retrieved basic glyph that topographically matches the selected glyph.
The present invention offers a system, method, and computer-readable medium for automatically converting an outline font into a glyph-based font using a set of predefined basic glyphs. The glyph-based font of the present invention defines each character with glyphs, and further defines each glyph based on a basic glyph, thereby significantly lowering the memory requirement needed to generate numerous characters. The glyph-based font thus has a low memory requirement and is highly suited for font communication between various devices. Furthermore, the glyph-based font is suited for high-quality display regardless of the resolution level of a particular output device used, and therefore is well suited for font communication between different systems having different resolutions.